import com.cha.user;
import com.cha.userService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Scanner;

public class hhh {
    @Test
    public void test1() {
        ApplicationContext cha;
        cha = new ClassPathXmlApplicationContext("user.xml"); //resources内文件没有后缀
        user user = (user)cha.getBean("user");

        userService userController = cha
                .getBean("userService",
                        userService.class);
        System.out.println("请学生进行账号注册");
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入学号");
        String number = scan.next();
        System.out.println("请输入密码");
        String password = scan.next();
        user.setNumber(number);
        user.setPassword(password);
        System.out.println(user);




    }
}